import type { AxiosResponse } from 'axios'
import request from '@/utils/request'

const serviceName = import.meta.env.VITE_APP_SREVICE_NAME_CITY_MANAGEMENT

/**
 * 重大事件接口
 */
class EventServe {
  /**
   * 获取事件详情
   */
  getEventsInfoById<T = any>(id: string): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/event/getEventsInfoById`,
      method: 'post',
      data: {
        id: id
      }
    })
  }
  /**
   * 诉求概览
   */
  getLivelihoodDemandMap<T = any>(map: object): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/event/getLivelihoodDemandMap`,
      method: 'post',
      data: map
    })
  }
  /**
   * 重点关注-重点诉求
   */
  getRightZdgzTableList<T = any>(map: object): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/event/getRightZdgzTableList`,
      method: 'post',
      data: map
    })
  }
  /**
   * 重点关注-重点人员
   */
  getRightTableMap<T = any>(map: object): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/event/getRightTableMap`,
      method: 'post',
      data: map
    })
  }
  /**
   * 热点关注  热点词汇Top5
   */
  getLowRdgzMap<T = any>(map: object): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/event/getLowRdgzMap`,
      method: 'post',
      data: map
    })
  }
  /**
   * 热点关注  词云
   */
  getRdgzWordCloud<T = any>(map: object): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/event/getRdgzWordCloud`,
      method: 'post',
      data: map
    })
  }
  /**
   * 情感指数
   */
  getFourTableMap<T = any>(map: object): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/event/getFourTableMap`,
      method: 'post',
      data: map
    })
  }
  /**
   * 区域排名
   */
  getRegionRank<T = any>(map: object): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/event/getRegionRank`,
      method: 'post',
      data: map
    })
  }
  /**
   * 重点人员详情
   */
  getKeyPersonInfoByPhone<T = any>(map: object): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/event/getKeyPersonInfoByPhone`,
      method: 'post',
      data: map
    })
  }
  /**
   * 重点诉求详情
   */
  getKeyPersonInfoByConcatWords<T = any>(map: object): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/event/getKeyPersonInfoByConcatWords`,
      method: 'post',
      data: map
    })
  }
  /**
   * 热点词汇趋势图
   */
  getTrendChart<T = any>(map: object): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/event/getTrendChart`,
      method: 'post',
      data: map
    })
  }
  /**
   * 热点词汇所在事件
   */
  getRelationWordsFloat<T = any>(map: object): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/event/getRelationWordsFloat`,
      method: 'post',
      data: map
    })
  }
}

export default new EventServe()
